#!/usr/bin/python

import sys

USAGE = 'USAGE: ' + sys.argv[0] + ' Classname'
IFDefine1='#ifndef KEYCOUNTSERVER_'
IFDefine2='#define KEYCOUNTSERVER_'
FileInclude = '#include "KeyCountServer.h"'
FileContent2='''{
public:

private:
};

#endif'''

def OutputH(Classname):
	Filename = Classname + '.h'
	try:
		fp = open(Filename, "w")
	except:
		print Classname + "open error!"

	fp.write(IFDefine1 + '\n')
	fp.write(IFDefine2 + '\n\n')
	fp.write(FileInclude + '\n\n')
	fp.write("class " + Classname + '\n')
	fp.write(FileContent2);
	fp.close()

def OutputCC(Classname):
	Filename = Classname + '.cpp'
	try:
		fp = open(Filename, "w")
	except:
		print Classname + "open error!"

	fp.write('#include "' + Classname + '.h"' + '\n\n')
	fp.close()

if __name__ == "__main__":
	if len(sys.argv) == 1:
		print USAGE
		exit(0)
	Classname = sys.argv[1]
	IFDefine1 = IFDefine1 + Classname.upper() + '_H_'
	IFDefine2 = IFDefine2 + Classname.upper() + '_H_'
	OutputH(Classname)
	OutputCC(Classname)

